package com.dameng.jianyouquan.api;

import com.dameng.jianyouquan.bean.CommonBean;
import com.dameng.jianyouquan.bean.ListWelfareBean;
import com.dameng.jianyouquan.bean.LoginBean;
import com.dameng.jianyouquan.bean.ShortPeroidListBean;
import com.dameng.jianyouquan.bean.SwichRoleBean;
import com.dameng.jianyouquan.bean.UserInfoBean;

import okhttp3.ResponseBody;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

public interface HttpGetService {


    //登录
    @FormUrlEncoded
    @POST("login")
    Observable<LoginBean> getLogin(@Field("mobile") String mobile, @Field("password") String password, @Field("wechatOpenid") String wechatOpenid);

    //发送验证码
    @GET("YanzhengCode/downCode")
    Observable<ResponseBody> getVerificationCode(@Query("mobileCode") String mobileCode);


    //忘记密码
    @FormUrlEncoded
    @POST("forgetPwd")
    Observable<ResponseBody> getForgetPwd(@Field("mobile") String mobile, @Field("password") String password, @Field("verifyCode") String verifyCode);

    //注册
    @FormUrlEncoded
    @POST("register")
    Observable<ResponseBody> getRegister(@Field("mobile") String mobile, @Field("password") String password, @Field("verifyCode") String verifyCode);


    //切换用户
    @FormUrlEncoded
    @POST("saveUserRole")
    Observable<SwichRoleBean> getSaveUserRole(@Field("userId") String userId, @Field("currentRole") String currentRole);


    //获取用户信息
    @GET("api/userInfo")
    Observable<UserInfoBean> getUserInfo();

    //退出登录
//    @FormUrlEncoded
    @POST("logout")
    Observable<CommonBean> getLogout();


    @GET("dict/listShortType")
    Observable<ShortPeroidListBean> getShortPeriodList();


    @GET("dict/listPostType")
    Observable<ResponseBody> getPeriodList();

    @GET("dict/listLongType")
    Observable<ShortPeroidListBean> getLongPeriodList();



    @GET("dict/listWelfare")
    Observable<ListWelfareBean> getWelfare();


}
